import requests
from config import server_chan_keys

def notify_wechat(title, message):
    for key in server_chan_keys:
        url = f"https://sctapi.ftqq.com/{key}.send"
        payload = {"title": title, "desp": message}
        try:
            res = requests.post(url, data=payload)
            print("✅ 推送成功" if res.ok else "❌ 推送失败")
        except Exception as e:
            print(f"推送异常: {e}") 